
<div class="aw-content-wrap" id="user_list">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#list" data-toggle="tab">会员列表</a></li>
                    <!--<li><a href="#search" data-toggle="tab">搜索</a></li>-->
                    <!--<li><a href="http://127.0.0.1/wenda/index.html?/admin/user/user_add/">添加用户</a></li>-->
                </ul>
            </h3>
        </div>
        <div class="mod-body tab-content">
            <div class="tab-pane active" id="list">
                
                <div class="table-responsive">
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th><div style="position: relative;" class="icheckbox_square-blue"><input style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="check-all" type="checkbox"><ins style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins></div></th>
                                <th>ID</th>
                                <th>用户名</th>
                                <th>邮箱</th>
                                <!--<th>会员组</th>-->
                                <th>系统组</th>
                                <th>注册时间</th>
                                <th>最后活跃</th>
                                <th>在线时长</th>
                                <!--<th>威望</th>-->
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name="useInfo" item="vo">
                            <form method="post" action="{:U('Admin/User/edit',array('id'=>$vo['id']))}" id="users_form">
                                <tr>
                                <td><div style="position: relative;" class="icheckbox_square-blue"><input style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" value="2" name="uids[]" type="checkbox"><ins style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins></div></td>
                                <td>{$vo['id']}</td>
                                <td><a href="http://127.0.0.1/wenda/?/people/leoma" target="_blank">{$vo['username']}</a> <span class="text-color-999">[ 邮件未验证 ]</span></td>
                                <td>{$vo['mail']}</td>
                                <!--<td>注册会员</td>-->
                                <td>{$vo['group_name']}</td>
                                <td>{$vo['register_time']|date='Y-m-d H:i:s',###}</td>
                                <td>
                                    <if condition="($nowTime-$vo['logout_time']) lt 60">
                                        {$nowTime-$vo['logout_time']|date='s',###} 秒
                                    <elseif condition="($nowTime-$vo['logout_time']) lt 3600"/>
                                        {$nowTime-$vo['logout_time']|date='i',###}分钟
                                    <elseif condition="($nowTime-$vo['logout_time']) lt 86400"/>
                                        {$nowTime-$vo['logout_time']|date='H',###}小时
                                    <elseif condition="($nowTime-$vo['logout_time']) lt 2592000"/>
                                        {$nowTime-$vo['logout_time']|date='d',###}天
                                    <elseif condition="($nowTime-$vo['logout_time']) lt 31104000"/>
                                        {$nowTime-$vo['logout_time']|date='m',###}月
                                    <else/>
                                        {$nowTime-$vo['logout_time']|date='Y',###}年
                                    </if>
                                    <!--{$nowTime - $vo['logout_time']|date=' H:i:s',###}-->
                                    前
                                </td>


                                <td>
                                    <if condition="$vo['online_time'] gt 3600">
                                        {$vo['online_time']|date='H',###} 小时
                                    <elseif condition="$vo['online_time'] between 60 and 3600">
                                        {$vo['online_time']|date='i',###} 分钟
                                    <else />
                                        {$vo['online_time']|date='s',###} 秒
                                    </if>
                                        <!--{$vo['online_time']|date='H:i:s',###}-->
                                </td>
                                <!--<td>0</td>-->
                                <td class="nowrap">
                                    <button data-original-title="编辑用户" class="icon icon-edit md-tip" title=""></button>
                                    <a href="{:U('Admin/User/close',array('id'=>$vo['id']))}" data-original-title="封禁用户" title="" class="icon icon-forbid md-tip"></a>
                                    <!--<a data-original-title="封禁用户" href="javascript:;" onclick="AWS.ajax_request(G_BASE_URL + '/admin/ajax/forbidden_user/' , 'uid=2&amp;status=1');" title="" class="icon icon-forbid md-tip"></a>-->
                                </td>
                            </tr>
                            </form>
                        </foreach>
                        </tbody>
                    </table>

                </div>
                <div class="mod-table-foot">
                    <div class="col-sm-4 col-xs-12">
                        <a class="btn btn-danger" onclick="AWS.ajax_post($('#users_form'));">删除</a>
                    </div>
                    <div class="col-xs-12 col-sm-8">
                                            </div>
                </div>
            </div>

            <div class="tab-pane" id="search">
                <form method="post" action="http://127.0.0.1/wenda/index.html?/admin/user/list/" onsubmit="return false;" id="search_form" class="form-horizontal" role="form">

                    <input name="action" value="search" type="hidden">

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">用户名:</label>

                        <div class="col-sm-5 col-xs-8">
                            <input class="form-control" name="user_name" type="text">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">邮箱:</label>

                        <div class="col-sm-5 col-xs-8">
                            <input class="form-control" name="email" type="text">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">用户组:</label>

                        <div class="col-sm-5 col-xs-8">
                            <select name="group_id" class="form-control">
                                <option selected="selected" value=""></option>
                                                                <option value="1">超级管理员</option>
                                                            <option value="2">前台管理员</option>
                                                            <option value="3">未验证会员</option>
                                                            <option value="4">普通会员</option>
                                                            <option value="99">游客</option>
                                                        </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">最后登录 IP 段:</label>

                        <div class="col-sm-5 col-xs-8">
                            <input class="form-control" name="ip" type="text">

                            <span class="help-block">限 C 段, 如: 203.31.42.*</span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">积分:</label>

                        <div class="col-sm-6 col-xs-9">
                            <div class="row">
                                <div class="col-xs-11  col-sm-5 mod-double">
                                    <input class="form-control" name="integral_min" type="text">
                                </div>
                                <span class="mod-symbol col-xs-1 col-sm-1">
                                -
                                </span>
                                <div class="col-xs-11 col-sm-5">
                                    <input class="form-control" name="integral_max" type="text">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">威望:</label>

                        <div class="col-sm-6 col-xs-9">
                            <div class="row">
                                <div class="col-xs-11  col-sm-5 mod-double">
                                    <input class="form-control" name="reputation_min" type="text">
                                </div>
                                <span class="mod-symbol col-xs-1 col-sm-1">
                                -
                                </span>
                                <div class="col-xs-11 col-sm-5">
                                    <input class="form-control" name="reputation_max" type="text">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">职业:</label>

                        <div class="col-sm-5 col-xs-8">
                            <select name="category_id" class="form-control">
                                <option selected="selected" value="0"></option>
                                                                    <option value="1">销售</option>
                                                                    <option value="2">市场/市场拓展/公关</option>
                                                                    <option value="3">商务/采购/贸易</option>
                                                                    <option value="4">计算机软、硬件/互联网/IT</option>
                                                                    <option value="5">电子/半导体/仪表仪器</option>
                                                                    <option value="6">通信技术</option>
                                                                    <option value="7">客户服务/技术支持</option>
                                                                    <option value="8">行政/后勤</option>
                                                                    <option value="9">人力资源</option>
                                                                    <option value="10">高级管理</option>
                                                                    <option value="11">生产/加工/制造</option>
                                                                    <option value="12">质控/安检</option>
                                                                    <option value="13">工程机械</option>
                                                                    <option value="14">技工</option>
                                                                    <option value="15">财会/审计/统计</option>
                                                                    <option value="16">金融/银行/保险/证券/投资</option>
                                                                    <option value="17">建筑/房地产/装修/物业</option>
                                                                    <option value="18">交通/仓储/物流</option>
                                                                    <option value="19">普通劳动力/家政服务</option>
                                                                    <option value="20">零售业</option>
                                                                    <option value="21">教育/培训</option>
                                                                    <option value="22">咨询/顾问</option>
                                                                    <option value="23">学术/科研</option>
                                                                    <option value="24">法律</option>
                                                                    <option value="25">美术/设计/创意</option>
                                                                    <option value="26">编辑/文案/传媒/影视/新闻</option>
                                                                    <option value="27">酒店/餐饮/旅游/娱乐</option>
                                                                    <option value="28">化工</option>
                                                                    <option value="29">能源/矿产/地质勘查</option>
                                                                    <option value="30">医疗/护理/保健/美容</option>
                                                                    <option value="31">生物/制药/医疗器械</option>
                                                                    <option value="32">翻译（口译与笔译）</option>
                                                                    <option value="33">公务员</option>
                                                                    <option value="34">环境科学/环保</option>
                                                                    <option value="35">农/林/牧/渔业</option>
                                                                    <option value="36">兼职/临时/培训生/储备干部</option>
                                                                    <option value="37">在校学生</option>
                                                                    <option value="38">其他</option>
                                                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">居住地:</label>

                        <div class="col-sm-3 col-xs-3">
                            <select style="display: inline-block;" name="province" class="select_area form-control"><option selected="selected" value="">请选择省份或直辖市</option><option value="安徽省">安徽省</option><option value="北京市">北京市</option><option value="福建省">福建省</option><option value="甘肃省">甘肃省</option><option value="广东省">广东省</option><option value="广西壮族自治区">广西壮族自治区</option><option value="贵州省">贵州省</option><option value="海南省">海南省</option><option value="河北省">河北省</option><option value="河南省">河南省</option><option value="黑龙江省">黑龙江省</option><option value="湖北省">湖北省</option><option value="湖南省">湖南省</option><option value="吉林省">吉林省</option><option value="江苏省">江苏省</option><option value="江西省">江西省</option><option value="辽宁省">辽宁省</option><option value="内蒙古自治区">内蒙古自治区</option><option value="宁夏回族自治区">宁夏回族自治区</option><option value="青海省">青海省</option><option value="山东省">山东省</option><option value="山西省">山西省</option><option value="陕西省">陕西省</option><option value="上海市">上海市</option><option value="四川省">四川省</option><option value="天津市">天津市</option><option value="西藏自治区">西藏自治区</option><option value="新疆维吾尔自治区">新疆维吾尔自治区</option><option value="云南省">云南省</option><option value="浙江省">浙江省</option><option value="重庆市">重庆市</option><option value="香港">香港</option><option value="澳门">澳门</option><option value="台湾">台湾</option></select>
                        </div>
                        <div class="col-sm-3 col-xs-3">
                            <select name="city" class="select_area form-control hide"></select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-5 col-xs-8">
                            <button type="button" onclick="AWS.ajax_post($('#search_form'));" class="btn btn-primary">搜索</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function () {
    $('.select_area').LocationSelect({
        labels: ["请选择省份或直辖市", "请选择城市"],
        elements: document.getElementsByTagName("select"),
        detector: function () {
            this.select(["", ""]);
        },
        dataUrl: G_BASE_URL.replace('/?', '') + '/static/js/areas.js'
    });
});
</script>
